
package org.wing.mouseListener;

import org.come.Frame.TestpackJframe;
import org.come.Frame.ZhuFrame;
import org.come.entity.Goodstable;
import org.wing.panel.LHMainPanel;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class LHChooseGoodsMouseListener extends MouseAdapter
{

	private LHMainPanel LHMainPanel;

	public LHChooseGoodsMouseListener(LHMainPanel LHMainPanel)
	{
		this.LHMainPanel = LHMainPanel;
	}

	public void mousePressed(MouseEvent e)
	{
		if (LHMainPanel.getRightType() == 4)
			return;
		if (e.getButton() == 3 && LHMainPanel.getChosegoods() != null)
		{
			LHMainPanel.setChosegoods(null);
			LHMainPanel.getChooseGoodsImg().setIcon(null);
		}
	}

	public void mouseEntered(MouseEvent e)
	{
		Goodstable goodstable = LHMainPanel.getChosegoods();
		if (goodstable != null)
			ZhuFrame.getZhuJpanel().creatgoodtext(goodstable);
	}

	public void mouseExited(MouseEvent e)
	{
		TestpackJframe.getTestpackJframe().getJpac().ClearText();
		ZhuFrame.getZhuJpanel().cleargoodtext();
	}
}
